package com.shoping.common.health;

import org.springframework.boot.actuate.health.Status;
import org.springframework.context.ApplicationEvent;

public class HealthStatusChangedEvent extends ApplicationEvent {

    private final Status before;
    private final Status current;

    private String message;

    public HealthStatusChangedEvent(Object source, Status before, Status current) {
        this(source, before, current, null);
    }

    public HealthStatusChangedEvent(Object source, Status before, Status current, String message) {
        super(source);
        this.before = before;
        this.current = current;
        this.message = message;
    }

    public Status getBefore() {
        return this.before;
    }

    public Status getCurrent() {
        return this.current;
    }

    public String getMessage() {
        return this.message;
    }
}
